package chapter01;

import java.util.Scanner;

public class Test10_Ternary {
    //三元运算符
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数字a:");
        int a = scanner.nextInt();
        System.out.println("请输入数字b：");
        int b = scanner.nextInt();
        int max = a>b?a:b;
        System.out.println("a和b之间的最大值为："+max);
        System.out.println("请输入数字c:");
        int c = scanner.nextInt();
        max = a>b?a>c?a:c:b>c?b:c;
        System.out.println("a、b和c之间的最大值为："+max);
    }
}
